/* ======================================================================================== *\

		FILE:				Pipe.h
		AUTHOR:				Jack Hoxley

		DESCRIPTION:		One or more pipes will grow until the layout is exhausted, the
							class defined in this header encapsulates the simulation of a
							single pipe.

		CHANGE:				5th May 2007
								Basic interface defined.
							8th May 2007
								Additional IntegerVector constructor defined
							14th July 2007
								Added 'RollBackLastMove()'
								Added 'SetLastUpdated()' and supporting member variable

\* ======================================================================================== */

#ifndef INC_PIPE_H
#define INC_PIPE_H

#include "Utils.h"

namespace PipeSim
{
	class Pipe
	{
		public:
			Pipe( const Utils::IntegerVector start );
			Pipe( const UINT16& startX, const UINT16& startY, const UINT16& startZ );
			~Pipe();

			UINT16 ChooseNextMove( const Utils::CoordinateList moves );
			void RollBackLastMove( );

			void SetLastUpdated( const UINT32& v );

			UINT32 LastUpdated( );

			Utils::IntegerVector Head();

			void CopyCurrentCoordinateList( Utils::CoordinateList* list );
			UINT32 GetPipeLength( );

		private:
			Utils::CoordinateList path;
			UINT32 m_LastUpdated;

			void PrintPath( );
	};
};

#endif